package com.CuiChangHe.studentmanager.controller;

import com.CuiChangHe.studentmanager.entity.userinfo.UserInfoReturnMsg;
import com.CuiChangHe.studentmanager.service.userinfo.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Description :用户信息获取Controller
 * @Author :崔昌赫
 * @Date : 2021/11/16
 */
@RestController
public class UserInfoController {

    private UserInfoService userInfoService;

    @Autowired
    public void setUserInfo(UserInfoService userInfoService) {
        this.userInfoService = userInfoService;
    }

    @GetMapping("/user/info")
    UserInfoReturnMsg getUserInfo(@RequestParam(value = "token",required = true) String token){
        return userInfoService.getUserInfoByToken(token);
    }
}
